import { MongoClient } from 'mongodb';
import { DATABASE_NAME } from '$lib/config.js';
import { MONGO_STRING } from "$env/static/private";

export async function connectToDatabase() {
  const client = await MongoClient.connect(MONGO_STRING);
  const db = client.db(DATABASE_NAME);
  return { db, client };
}